﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zeus.Thunder.Menu;

namespace SharpTrainer
{
    public class MenuUtil
    {
        public static MainMenu GenMenu()
        {
            //Basic
            SubMenu subMenuBasic = new SubMenu("Basic", "SharpTrainer.Basic");
            subMenuBasic.AddMenuItem(new MenuItem("String Contain Test", "StringContain"));
            subMenuBasic.AddMenuItem(new MenuItem("Ref Param Test", "TestRefParam"));
            subMenuBasic.AddMenuItem(new MenuItem("Swap Array Elements Test", "SwapArrayElements"));
            subMenuBasic.AddMenuItem(new MenuItem("Dynamic Number Param Test", "DynNumParam"));
            subMenuBasic.AddMenuItem(new MenuItem("Show Dynamic Types Test", "ShowDynTypes"));
            subMenuBasic.AddMenuItem(new MenuItem("Constructor Test", "ConstructorTest"));
            subMenuBasic.AddMenuItem(new MenuItem("Array Copy Test", "ArrayCopyTest"));
            subMenuBasic.AddMenuItem(new MenuItem("IndexOf Test", "IndexOfTest"));

            //Collections
            SubMenu subMenuCollections = new SubMenu("Collections", "SharpTrainer.Collections");
            subMenuCollections.AddMenuItem(new MenuItem("Array Test", "ArrayTest"));
            subMenuCollections.AddMenuItem(new MenuItem("Stack Test", "StackTest"));
            subMenuCollections.AddMenuItem(new MenuItem("Queue Test", "QueueTest"));
            subMenuCollections.AddMenuItem(new MenuItem("Generic Stack Test", "GenericStack"));
            subMenuCollections.AddMenuItem(new MenuItem("Generic Dictionary Test", "GenericDict"));
            subMenuCollections.AddMenuItem(new MenuItem("Count Words Test", "CountWords"));
            subMenuCollections.AddMenuItem(new MenuItem("Generic Pair Test", "GenericPair"));
            subMenuCollections.AddMenuItem(new MenuItem("ArrayList Test", "ArrayListTest"));
            subMenuCollections.AddMenuItem(new MenuItem("Hashtable Test", "HashtableTest"));
            subMenuCollections.AddMenuItem(new MenuItem("LinkedList Test", "LinkedListTest"));
            subMenuCollections.AddMenuItem(new MenuItem("HashSet Test", "HashSetTest"));
            subMenuCollections.AddMenuItem(new MenuItem("CopyList Test", "CopyListTest"));
            subMenuCollections.AddMenuItem(new MenuItem("Remove Duplicate Test", "RemoveDuplicateTest"));

            //Delegate
            SubMenu subMenuDelegate = new SubMenu("Delegate", "SharpTrainer.Delegates");
            subMenuDelegate.AddMenuItem(new MenuItem("Simple Delegate Test", "SimpleDelegate"));
            subMenuDelegate.AddMenuItem(new MenuItem("Anonymous Delegate Test", "AnonymousDelegate"));
            subMenuDelegate.AddMenuItem(new MenuItem("Delegate Sort Test", "TestDelegateSort"));
            subMenuDelegate.AddMenuItem(new MenuItem("Bubble Sorter Test", "TestBubbleSorter"));
            subMenuDelegate.AddMenuItem(new MenuItem("Multicast Delegate Test", "MulticastDelegate"));
            subMenuDelegate.AddMenuItem(new MenuItem("Multicast Delegate Test2", "MulticastDelegateTest2"));
            subMenuDelegate.AddMenuItem(new MenuItem("Simple Func Test", "SimpleFunc"));
            subMenuDelegate.AddMenuItem(new MenuItem("Simple Operation Test", "BinOpTest"));
            subMenuDelegate.AddMenuItem(new MenuItem("Anonymous Operation Test", "AnonymousBinOp"));
            subMenuDelegate.AddMenuItem(new MenuItem("Simple Lamda Test", "SimpleLamda"));
            subMenuDelegate.AddMenuItem(new MenuItem("Linq Lamda Test", "LinqLamdaTest"));
            subMenuDelegate.AddMenuItem(new MenuItem("Delegate Combine Test", "DelegateCombine"));
            subMenuDelegate.AddMenuItem(new MenuItem("Delegate Combine Test2", "DelegateCombine2"));
            subMenuDelegate.AddMenuItem(new MenuItem("Instance Delegate Method Test", "InstanceDelegateMethodTest"));
            subMenuDelegate.AddMenuItem(new MenuItem("Generic Delegate Test", "GenericDelegateTest"));
            subMenuDelegate.AddMenuItem(new MenuItem("Replace Delegate With Interface", "ReplaceDelegateWithInterface"));

            //Event
            SubMenu subMenuEvent = new SubMenu("Event", "SharpTrainer.Event");
            subMenuEvent.AddMenuItem(new MenuItem("Mail Event Client", "MailEventClient"));
            subMenuEvent.AddMenuItem(new MenuItem("Stock Event Test", "StockEventTest"));

            //FileStream
            SubMenu subMenuFileStream = new SubMenu("FileStream", "SharpTrainer.FileStreams");
            subMenuFileStream.AddMenuItem(new MenuItem("Get Files From Directory", "GetFilesFromDirTest"));
            subMenuFileStream.AddMenuItem(new MenuItem("Stream Reader Writer Test", "StreamReaderWriterTest"));
            subMenuFileStream.AddMenuItem(new MenuItem("Text Reader Writer Test", "TextReaderWriterTest"));
            subMenuFileStream.AddMenuItem(new MenuItem("Binary Reader Writer Test", "BinaryReaderWriterTest"));

            //Threads
            SubMenu subMenuThread = new SubMenu("Threads", "SharpTrainer.Threads");
            subMenuThread.AddMenuItem(new MenuItem("Create Thread Test", "CreateThreadTest"));
            subMenuThread.AddMenuItem(new MenuItem("Create Multiple Threads Test", "CreateMultiThreadTest"));
            subMenuThread.AddMenuItem(new MenuItem("Thread Playaround Test", "ThreadPlayaround"));

            //Data Access
            SubMenu subMenuDataAccess = new SubMenu("Data Access", "SharpTrainer.DataAccess");
            subMenuDataAccess.AddMenuItem(new MenuItem("Execute Reader Demo", "ExecuteReaderDemo"));
            subMenuDataAccess.AddMenuItem(new MenuItem("Get Table Columns", "GetTableColumns"));

            //Other
            SubMenu subMenuOther = new SubMenu("Other", "SharpTrainer.Other");
            subMenuOther.AddMenuItem(new MenuItem("Extension Method Test", "ExtensionMethodTest"));
            subMenuOther.AddMenuItem(new MenuItem("Lamda Expression Test", "LamdaExpressionTest"));
            subMenuOther.AddMenuItem(new MenuItem("Memory Linq Test", "MemoryLinq"));
            subMenuOther.AddMenuItem(new MenuItem("Xml Linq Test", "LinqXmlTest"));
            subMenuOther.AddMenuItem(new MenuItem("Color Convert Test", "ColorConvertTest"));
            subMenuOther.AddMenuItem(new MenuItem("Serialize To Memory Test", "SerializeToMemoryTest"));
            subMenuOther.AddMenuItem(new MenuItem("GTA JSON Response", "GetResponseFromUrl"));
            subMenuOther.AddMenuItem(new MenuItem("Json Serialize Test", "JsonSerializeTest"));
            subMenuOther.AddMenuItem(new MenuItem("Json Serialize Test2", "JsonSerializeTest2"));
            subMenuOther.AddMenuItem(new MenuItem("GTA JSON Analyze Test", "GtaJsonAnalyzeTest"));
            subMenuOther.AddMenuItem(new MenuItem("Timer Test", "TimerTest"));
            subMenuOther.AddMenuItem(new MenuItem("Process Console Test", "ProcessConsoleTest"));
            subMenuOther.AddMenuItem(new MenuItem("Zip File Test", "ZipFileTest"));
            subMenuOther.AddMenuItem(new MenuItem("Zip File Test2(has files in zip)", "ZipFileTest2"));

            //Xml
            SubMenu subMenuXml = new SubMenu("Xml", "SharpTrainer.Xml");
            subMenuXml.AddMenuItem(new MenuItem("Write Xml Test", "WriteXmlTest1"));
            subMenuXml.AddMenuItem(new MenuItem("Write Format Xml", "WriteFormatXml1"));
            subMenuXml.AddMenuItem(new MenuItem("XPath Test", "XPathTest"));
            subMenuXml.AddMenuItem(new MenuItem("Xml Serialize Test", "XmlSerializeTest"));

            // Serialization
            SubMenu subMenuSerialization = new SubMenu("Serialization", "SharpTrainer.Serialization");
            subMenuSerialization.AddMenuItem(new MenuItem("Data Contract Xml Serialize Test", "DataContractXmlSerializeTest"));
            subMenuSerialization.AddMenuItem(new MenuItem("Xml Setting Test", "XmlSettingTest"));

            //Kiss Data
            SubMenu subMenuKissData = new SubMenu("Kiss Data", "SharpTrainer.KissData");
            subMenuKissData.AddMenuItem(new MenuItem("Read By Column", "ReadByColumn1"));
            subMenuKissData.AddMenuItem(new MenuItem("Get Employee Test", "GetEmployeeTest"));
            subMenuKissData.AddMenuItem(new MenuItem("Stored Procedure Test", "SpTest1"));
            subMenuKissData.AddMenuItem(new MenuItem("Linq Filter Test", "FilterByLinq"));

            //Postgresql
            SubMenu subMenuPostgresql = new SubMenu("Postgresql", "SharpTrainer.Postgresql");
            subMenuPostgresql.AddMenuItem(new MenuItem("Get Contact Test", "GetContactTest"));
            subMenuPostgresql.AddMenuItem(new MenuItem("Get Character List Test", "GetCharacterListTest"));

            //NHibernate
            SubMenu subMenuNHibernate = new SubMenu("NHibernate", "SharpTrainer.NHibernate");
            subMenuNHibernate.AddMenuItem(new MenuItem("Create Database Tables", "CategoryTest"));
            subMenuNHibernate.AddMenuItem(new MenuItem("Insert Data Into Category Table", "AddCategoryTest"));
            subMenuNHibernate.AddMenuItem(new MenuItem("Query Category and Article Table", "QueryCategoryArticleTest"));
            subMenuNHibernate.AddMenuItem(new MenuItem("Add Student Test", "AddStudent"));
            subMenuNHibernate.AddMenuItem(new MenuItem("Update Student Test", "UpdateStudent"));
            subMenuNHibernate.AddMenuItem(new MenuItem("Delete Student Test", "DeleteStudent"));
            subMenuNHibernate.AddMenuItem(new MenuItem("Query Employee Test", "HbQueryTest1"));

            //Linq
            SubMenu subMenuLinq = new SubMenu("Linq", "SharpTrainer.Linq");
            subMenuLinq.AddMenuItem(new MenuItem("Simple Chaining", "SimpleChaining"));
            subMenuLinq.AddMenuItem(new MenuItem("Get All Employees", "GetAllEmployeesTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Add Employee", "AddEmployeeTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Add Cascade Tables", "AddCascadeTablesTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Get Employee Orders(Multi Table Join)", "GetEmployeeOrderTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Enumerable Linq Test", "EnumerableLinqTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Linq Join Compare", "LinqJoinCompare"));
            subMenuLinq.AddMenuItem(new MenuItem("Linq Group Test", "LinqGroupTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Linq Operation Test", "LinqOpTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Linq To Xml Test", "LinqToXmlTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Sub Query Test", "SubQueryTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Dir List", "DirList"));
            subMenuLinq.AddMenuItem(new MenuItem("GroupBy Test", "GroupByTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Group By Test2", "GroupByTest2"));
            subMenuLinq.AddMenuItem(new MenuItem("Aggregate Test", "AggregateTest"));
            subMenuLinq.AddMenuItem(new MenuItem("Quantifiers Test", "QuantifiersTest"));

            //Spring
            SubMenu subMenuSpring = new SubMenu("Spring", "SharpTrainer.Spring");
            subMenuSpring.AddMenuItem(new MenuItem("Spring.NET Hello World", "SpringHelloTest"));
            subMenuSpring.AddMenuItem(new MenuItem("Spring.NET Device Injection", "SpringHelloTest"));
            subMenuSpring.AddMenuItem(new MenuItem("Spring.NET Person Injection", "PersonTest"));

            //JSON
            SubMenu subMenuJSON = new SubMenu("JSON", "SharpTrainer.JSON");
            subMenuJSON.AddMenuItem(new MenuItem("Basic Query Test", "BasicQueryTest"));

            //Design Pattern
            SubMenu subMenuDP = new SubMenu("Design Pattern", "SharpTrainer.DesignPattern");
            subMenuDP.AddMenuItem(new MenuItem("Prototype Generic", "PrototypeGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Factory Method Generic", "FactoryMethodGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Abstract Factory Generic", "AbstractFactoryGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Builder Generic", "BuilderGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Singleton Generic", "SingletonGenericTest"));
            subMenuDP.AddMenuItem(new MenuItem("Bridge Generic", "BridgeGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Composite Generic", "CompositeGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Facade Generic", "FacadeGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Flyweight Generic", "FlyweightGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Proxy Generic", "ProxyGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Decorator Generic", "DecoratorGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Adapter Generic", "AdapterGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Visitor Generic", "VisitorGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("Observer Generic", "ObserverGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("ChainResp Generic", "ChainRespGenTest"));
            subMenuDP.AddMenuItem(new MenuItem("TemplateMethod Generic", "TemplateMethodGenTest"));

            //MongoDB
            //Design Pattern
            SubMenu subMenuMongo = new SubMenu("Mongo DB", "SharpTrainer.MongoDB");
            subMenuMongo.AddMenuItem(new MenuItem("Mongo DB Add", "MongoAddTest"));
            subMenuMongo.AddMenuItem(new MenuItem("Mongo Single Query Test", "MongoQueryTest"));
            subMenuMongo.AddMenuItem(new MenuItem("Mongo Query Like Test", "MongoQueryLikeTest"));
            subMenuMongo.AddMenuItem(new MenuItem("Mongo Update Single Test", "MongoUpdateSingleTest"));
            subMenuMongo.AddMenuItem(new MenuItem("Mongo Delete Test", "MongoDelTest"));

            //Reflection
            SubMenu subMenuReflection = new SubMenu("Reflection", "SharpTrainer.Reflection");
            subMenuReflection.AddMenuItem(new MenuItem("Property Reflection Test", "PropertyReflectionTest"));
            subMenuReflection.AddMenuItem(new MenuItem("Generic Property Test", "GenericPropertyTest"));

            // Concurrency
            SubMenu subMenuConcurrency = new SubMenu("Concurrency", "SharpTrainer.Concurrency");
            subMenuConcurrency.AddMenuItem(new MenuItem("Async Callback Test", "AsyncCallbackTest"));
            subMenuConcurrency.AddMenuItem(new MenuItem("Event Async Test", "EventAsyncTest"));
            subMenuConcurrency.AddMenuItem(new MenuItem("Simple Task Test", "SimpleTaskTest"));
            subMenuConcurrency.AddMenuItem(new MenuItem("Passing Data Test", "PassDataTest"));
            subMenuConcurrency.AddMenuItem(new MenuItem("Asyn Download Web Test", "AsynDownloadWebTest"));
            subMenuConcurrency.AddMenuItem(new MenuItem("Better Asyn Download Test", "BetterAsynDownloadTest"));
            subMenuConcurrency.AddMenuItem(new MenuItem("Progress Test", "ProgressTest"));
            subMenuConcurrency.AddMenuItem(new MenuItem("Async Result Test", "AsyncResultTest"));

            // NetWork
            SubMenu subMenuNetWork = new SubMenu("NetWork", "SharpTrainer.NetWork");
            subMenuNetWork.AddMenuItem(new MenuItem("Smtp Client Test", "SmtpClientTest"));
            subMenuNetWork.AddMenuItem(new MenuItem("Tcp Demo Test", "TcpDemoTest"));

            //Main Menu
            MainMenu menu = new MainMenu();
            menu.AddSubMenu(subMenuBasic);
            menu.AddSubMenu(subMenuCollections);
            menu.AddSubMenu(subMenuDelegate);
            menu.AddSubMenu(subMenuEvent);
            menu.AddSubMenu(subMenuFileStream);
            menu.AddSubMenu(subMenuThread);
            menu.AddSubMenu(subMenuDataAccess);
            menu.AddSubMenu(subMenuOther);
            menu.AddSubMenu(subMenuXml);
            menu.AddSubMenu(subMenuSerialization);
            menu.AddSubMenu(subMenuKissData);
            menu.AddSubMenu(subMenuPostgresql);
            menu.AddSubMenu(subMenuNHibernate);
            menu.AddSubMenu(subMenuLinq);
            menu.AddSubMenu(subMenuSpring);
            menu.AddSubMenu(subMenuJSON);
            menu.AddSubMenu(subMenuDP);
            menu.AddSubMenu(subMenuMongo);
            menu.AddSubMenu(subMenuReflection);
            menu.AddSubMenu(subMenuConcurrency);
            menu.AddSubMenu(subMenuNetWork);
            
            return menu;
        }
    }
}
